<template>
  <div class="user_contaienr">
    <el-card>
      <searchCom :form="form" @changeFormValue="changeFormValue" @searchForm="searchForm"></searchCom>
      <searchTable></searchTable>
      <!-- <span>{{ count }}</span> -->
    </el-card>
  </div>
</template>

<script setup lang="ts" name="userPage">
import { userSearch } from '@/type/role'
import { ref, reactive, provide } from 'vue'
import searchCom from './components/search.vue'
import searchTable from './components/searchTable.vue'
const form = reactive<userSearch>({
  name: "",
  idCard: ""
})

// const count = ref(0)
// const changeCount = (value: number) => {
//   console.log(value, 'value');
//   count.value += value
// }
// provide('count', count)
// provide('changeCount', changeCount)

// 接收子组件更改的数据
const changeFormValue = (value: userSearch) => {
  form.name = value.name
  form.idCard = value.idCard
}
const searchForm = (value: userSearch) => {
  console.log(value, 'value');
}

</script>

<style scoped lang="less">
.user_contaienr {}
</style>